﻿<%@ Page Language="C#" MasterPageFile="~/MasterPage/MasterPage.master" AutoEventWireup="true" CodeFile="RoleManagement.aspx.cs" Inherits="Pages_RoleManagement" Title="Role Management"%>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div>
        <table width="100%">
            <tr>
                <td width="55%" valign="top">
                    <asp:Panel ID="pnlRole" runat="server" BorderStyle="Solid" BorderColor="Black" BorderWidth="1px">
                        <table width="100%">
                            <tr>
                                <td width="100%" valign="top">
                                    <asp:Panel ID="pnlRoleManagement" runat="server" GroupingText="Role Management">
                                        <table width="100%">
                                            <tr>
                                                <td width="10%" align="left">
                                                    <asp:Label ID="lblRoleName" runat="server" Text="Role Name: "></asp:Label>
                                                </td>
                                                <td width="90%">
                                                    <asp:TextBox ID="txtRoleName" runat="server" Width="100%"></asp:TextBox>
                                                    <asp:HiddenField ID="hdnRoleName" runat="server" />
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="10%" align="left">
                                                    <asp:Label ID="lblDescription" runat="server" Text="Description: "></asp:Label>
                                                </td>
                                                <td width="90%">
                                                    <asp:TextBox ID="txtDescription" runat="server" Width="100%" TextMode="MultiLine"></asp:TextBox>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="10%">
                                                </td>
                                                <td width="90%">
                                                </td>
                                            </tr>

                                            <tr>
                                                <td width="100%" colspan="2">
                                                <asp:Panel ID="pnlPages" runat="server" GroupingText="Select Permitted Page(s) for this Role">
                                        <div>
                                            <asp:GridView ID="grdPages" runat="server" DataKeyNames="Title" AutoGenerateColumns="false"
                                            BorderColor="#336699" BorderStyle="Solid" BorderWidth="2px" ForeColor="#333333"
                                            CellPadding="4" Width="100%">
                                            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                            <SelectedRowStyle BackColor="#879464" Font-Bold="True" ForeColor="#333333" />
                                            <Columns>
                                                 <asp:TemplateField HeaderText="Select" ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
                                                    <ItemTemplate>
                                                        <asp:CheckBox ID="chkSelect" runat="server" />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Title" ItemStyle-Width="90%">
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblTitle" runat="server" Text='<%# Bind("Title") %>'></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                            </Columns>
                                        </asp:GridView>
                                        </div>
                                    </asp:Panel>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="100%" colspan="2">
                                                </td>
                                            </tr>
                                            <tr>
                                                <td width="100%" colspan="2">
                                                    <table width="100%">
                                                        <tr>
                                                            <td width="58%">
                                                                <asp:Label ID="lblMessege" runat="server" ></asp:Label>
                                                            </td>
                                                            <td width="20%">
                                                                <asp:Button ID="btnSave" runat="server" Text="Save" Width="100%" 
                                                                    onclick="btnSave_Click" />
                                                            </td>
                                                            <td width="2%">
                                                            </td>
                                                            <td width="20%">
                                                                <asp:Button ID="btnCancel" runat="server" Text="Cancel" Width="100%" 
                                                                    onclick="btnCancel_Click" />
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </td>
                                            </tr>
                                        </table>
                                    </asp:Panel>
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </td>
                <td width="45%" valign="top">
                    <asp:Panel ID="Panel1" runat="server" BorderStyle="Solid" BorderColor="Black" BorderWidth="1px">
                        <table width="100%">
                            

                            <tr>
                                <td width="100%">
                                    <asp:Panel ID="pnlSearch" runat="server" GroupingText="Search" cellspacing="0" cellpadding="0">
                                        <table width="100%">
                                            <tr>
                                                <td width="20%">
                                                    <asp:Label ID="lblRoleSearchName" runat="server" Text="Role Name: "></asp:Label>
                                                </td>
                                                <td width="58%">
                                                    <asp:TextBox ID="txtSearch" runat="server" Width="100%"></asp:TextBox>
                                                </td>
                                                <td width="2%">
                                                </td>
                                                <td width="20%">
                                                    <asp:Button ID="btnSearch" runat="server" Text="Search" Width="100%" />
                                                </td>
                                            </tr>
                                        </table>
                                    </asp:Panel>
                                </td>
                            </tr>
                            <tr>
                                <td width="100%">
                                    <asp:Panel ID="pnlRoleList" runat="server" GroupingText="Role Lists">
                                        <asp:GridView ID="grdRole" runat="server" DataKeyNames="RoleId" AutoGenerateColumns="false"
                                            BorderColor="#336699" BorderStyle="Solid" BorderWidth="2px" ForeColor="#333333"
                                            CellPadding="4" Width="100%" onrowdeleting="grdRole_RowDeleting" onrowediting="grdRole_RowEditing">
                                            <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                                            <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                                            <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                                            <SelectedRowStyle BackColor="AppWorkspace"/>
                                            <Columns>
                                                <asp:TemplateField ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
                                                    <ItemTemplate>
                                                        <asp:LinkButton ID="LnkEdit" runat="server" CommandArgument='<%# Eval("RoleName") %>'
                                                            CommandName="Edit" Text="Edit" ForeColor="Blue" />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField ItemStyle-Width="10%" ItemStyle-HorizontalAlign="Center">
                                                    <ItemTemplate>
                                                        <asp:LinkButton ID="LnkDelete" runat="server" CommandArgument='<%# Eval("RoleName") %>'
                                                            CommandName="Delete" OnClientClick='return confirm("Are you sure you want to delete this entry?");' Text="Delete" ForeColor="Blue" />
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                                <asp:TemplateField HeaderText="Role Name" ItemStyle-Width="30%">
                                                    <ItemTemplate>
                                                        <asp:Label ID="lblRoleName" runat="server" Text='<%# Bind("RoleName") %>'></asp:Label>
                                                    </ItemTemplate>
                                                </asp:TemplateField>
                                            </Columns>
                                        </asp:GridView>
                                    </asp:Panel>
                                </td>
                            </tr>
                        </table>
                    </asp:Panel>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
